/**
 *
 * @author zzhijie
 * @date 2021-05-26
 */
import Vue from "vue";

const trackData = {
  type: "click",
  desc: "点击了xxx",
  target: "",

}
const trackQueue = [];
const promiseCatch = Promise.prototype.catch;
const trackPromiseCatch = function (callback) {
  const trackCallback = function (...err) {
    console.error("promise统一异常捕获", ...err);
    callback(...err);
  }
  return promiseCatch.call(this, trackCallback);
}
Promise.prototype.catch = trackPromiseCatch;
Vue.config.errorHandler = function (err, vm, info) {
  console.error("Vue统一异常捕获", err, vm, info);
}
addEventListener("unhandledrejection", ev => {
  console.error(ev);
})
addEventListener("rejectionhandled", ev => {
  console.error(ev);
})
addEventListener("click", ev => {
  console.log(ev);
},true)
